package Web;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

import javax.swing.JOptionPane;

public class ToSearchCodeWeb {

	public static String contenido = "";

	ToSearchCodeWeb() throws IOException
	{			
		System.out.println(getContenidoHTML());			

	}

	private String getContenidoHTML() throws IOException {

		URL url = new URL("http://www.lorikero.com/penny-auction/318-Auriculares_BOSE_AE2");
		//URL url = new URL("http://www.lorikero.com/penny-auction/744-Camara_Canon_T3_12_2_Mpx_-_Lente_18-55_Video_Hd");
		URLConnection uc = url.openConnection();
		uc.connect();
		//Creamos el objeto con el que vamos a leer
		BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
		String inputLine;

		/**
		    inputLine = in.readLine();
		    contenido = inputLine;
		 ***/
		while ((inputLine = in.readLine()) != null) {		  

			//JOptionPane.showMessageDialog(null, inputLine); 	

			contenido += inputLine + "\n";
		}

		in.close();
		return contenido;
	}

	public static void main(String[] args) throws IOException {

		ToSearchCodeWeb in = new ToSearchCodeWeb();


	}
}